#ifndef SDK_OHOS_API_OHOS_RTP_RECEIVER_INTERFACE_H_
#define SDK_OHOS_API_OHOS_RTP_RECEIVER_INTERFACE_H_

#include <vector>
#include "api/ref_count.h"
#include "api/scoped_refptr.h"
#include "api/media_types.h"
#include "api/rtp_parameters.h"
#include "api/rtp_receiver_interface.h"
#include "ohos_media_stream_interface.h"
#include "ohos_media_track_interface.h"

namespace ohoswebrtc {

class OHOSRtpReceiverObserver {
 public:
  virtual void OnFirstPacketReceived(cricket::MediaType media_type) = 0;

 protected:
  virtual ~OHOSRtpReceiverObserver() {}
};

class OHOSRtpReceiverInterface : public webrtc::RefCountInterface {
  public:

    /** The OHOSMediaTrack associated with the receiver. */
    virtual rtc::scoped_refptr<OHOSMediaTrackInterface> track() const = 0;

    /** The list of stream_ids that `track` is associated with.  */
    virtual const std::vector<std::string> stream_ids() const = 0;
    
    /** The list of streams that `track` is associated with.  */
    virtual std::vector<rtc::scoped_refptr<OHOSMediaStreamInterface>> streams() const = 0;

    /**Media type for Audio or video receiver */
    virtual cricket::MediaType media_type() const = 0;
    
    /**temporarily use to uniquely identify a receiver until we implement Unified Plan SDP */
    virtual const std::string received_id() const = 0;

    /**The WebRTC specification only defines RTCRtpParameters in terms of senders */
    virtual webrtc::RtpParameters parameters() const = 0;
    
    /**
     * RtpReceiverInterface representation of this OHOSRtpReceiver object. This is
     * needed to pass to the underlying C++ APIs.
     */
    virtual rtc::scoped_refptr<webrtc::RtpReceiverInterface> rtp_receiver() const = 0;

    /** Sets a user defined frame decryptor that will decrypt the entire frame before it is sent across the network. */
    virtual void SetFrameDecryptor(rtc::scoped_refptr<webrtc::FrameDecryptorInterface> frame_decryptor) = 0;
    
    
    virtual rtc::scoped_refptr<webrtc::FrameDecryptorInterface> frame_decryptor() const = 0;
  
    /** Sets a frame transformer between the depacketizer and the decoder to enable
     * client code to transform received frames according to their own processing logic
    **/
    virtual void SetDepacketizerToDecoderFrameTransformer(
      rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer) = 0;

   /** Default implementation of SetFrameTransformer. */
    virtual void SetFrameTransformer(rtc::scoped_refptr<webrtc::FrameTransformerInterface> frame_transformer) = 0;
  
    /**
     * Sets the jitter buffer minimum delay until media playout. Actual observed
     * delay may differ depending on the congestion control. `delay_seconds` is a
     * positive value including 0.0 measured in seconds. `nullopt` means default
     * value must be used.
     */
    virtual void SetJitterBufferMinimumDelay(double delay_seconds) = 0;

    /**
     * register OnFirstPacketReceived Observer
     */
    virtual void RegisterObserver(OHOSRtpReceiverObserver* observer) = 0;

  protected:
    virtual ~OHOSRtpReceiverInterface() {}
};

}

#endif
